Hello and welcome.
In this video I'm going to quickly run through the pounds to kilogramme conversion tool the call his
very identical for the code we use for the killer ground to pound conversions so I'm not going to explain
to Mike because the chords is identical.
I will only focus on the areas that are different.
So this is the hastier male for the pounds 2 kg I have called it p to cagy to hate mail and I've saved
it inside the same directory as the kilogram two pound conversion.
So all the files are gonna be in the same directly but I have given them different names.
So this is the highest email for the pownce to kilogramme which I have caught.
P to Katie's or his team.
So the email is basically the same.
The only thing that's changed here is the title.
I've changed the title to parts of kilogramme weight compared to the CNS is all I've done is changed
the name of the CSA So they are going to use the same C Ss type just change to name contain the same
thing again.
The code is saying All I've done here change the title fully hate one tag to wait.
Convert time lbs.
Here is a clock tower.
Your weight value in pounds because we're converted from Pants shoe kilos here.
The labels obviously is changed.
So where we had the label in kilograms when we do the kilogram one here we've got a label same pounds
so they're going to import the value in pounds.
Also being put tidy has changed.
Where in the kilogram a pound we weigh in put in kilograms.
Now we import impoundments.
The type is no the type of input.
And then replace or die inside the place or.
I am just going to have lb in there and bet on input.
Again we're going to use the same function.
I've called it the same name wave converter function and this will grab whatever value you input into
this input field.
This bisley is this is a key word is use to access the current value and these function here code with
converter will do the conversion from pownce to kg on change.
This metaphysically this attribute here we'll call this function when the values.
Each time you enter a new value into the input it will trigger this change here event that will call
this function.
Okay and what about value you've entered would be re calculate it.
Again this is just a paragraph that will import the value of the leithead Conversion.
It will happen that you in this band element to this text here.
My 22 is just a reference to the external javascript.
Again like the kilogram to I've just call it to key.
It's a very basic stuff similar to what we did with the kilogramme two point conversion.
So this is the hastier about.
Let's take a look at a java script.
This is a javascript I have used for the pounds 2 kg is basically the same thing as we did with the
kilogramme to point a game with a function called Wave converter.
We aren't grabbing the value of the number that is passed into the input field.
Here I've created two variables one for the value of the number and I send that to you.
So the value of no.
The only difference here with pounds 2 kg conversion we more plight so one kg basically said is is going
to be divided by.
So to get the value of the conversion you divide okay by this number.
Remember when we did the key to point we multiplied.
So here we are dividing rather than multiply as will multiply the value by two point to zero for six.
So that's the key difference between the two kg to pound.
You multiply this value down 2 kg.
You divide the value variable here code n we grab in this variable.
Here we are set in we is in this to fix it.
To round up the value to zero decimal places so we can just get whole numbers are posted rather than
several numbers.
So if you wanted to prefix yours to two decimal places you can just put two there I've put in has zero
cause I don't want any decimal places.
And so I have put a value of c again like the kilogram two point conversion We years in a document.
OK.
Elemen by T.
And we get in this I'll put KG So if we go into the hastier mill This is what we grab.
This is the idea of this span element here.
We'll in that and whatever value is imported from the value of this couple lation we are going to add
that to these outputs.
KG So if you go here you can see this our PUD kg's is going to spend this to this to see your weight
in kilograms is where there are put at for that kilograms so that's basically it.
All right so the code is basically a complete is identical to what we did with the kilogram two point
conversion.
The other key difference is that with a kilogram two pounds you multiply it by this number whereas with
the pound two kilogram conversion you are dividing by the number.
Again this here says I have used exactly the same assess for this pound two kilogram conversion two
because all I'm doing this time in the container which I have is to allow it and I've done is just changed
a colour where the kilogram to pound.
I use it purple colour for the background here I am in a blue colour for the background so that's basically
it.
So let me see that and then we can run it.
So these are all the farms inside this same directory.
So the one we've just created here is a pound to kilograms a wing a rum in your file that is the hastier
mail file you need to run because it's linked to the old farts someone from the pound to kilogramme
conversion to wishes this one double click and he can see five.
Type in and find the compound.
He can see.
Gives me the corresponding value in kilograms.
So this concludes the projet.
If you have any issues at all please do not hesitate to contact me.
Be more than happy to assist.
Thanks very much.
Take care and all the best.
Bye for now.